<template>
	<om-page>
		<view class="padding-xl text-center text-xxl bg-steelblue">身份验证</view>
		<view class="content">
			<!-- #ifdef H5 || APP-PLUS -->
			<view class="input-group">
				<view class="input-row border">
					<text class="title">身份证号：</text>
					<m-input class="m-input" type="text" clearable focus v-model="idcard"></m-input>
				</view>
			</view>
			<view class="btn-row"><button type="primary" class="primary" @tap="bindVerify">下一步</button></view>
			<om-wing-blank class="tui-flex justify-end">
				<view @click="login" class='cu-tag radius bg-grey'>登录</view>
			</om-wing-blank>
			<!-- #endif -->
		</view>
	</om-page>
</template>

<script>
	import md5 from '@/static/js/md5.js';
	import {
		ignoreHtml
	} from 'static/js/common.js'
	import service from '@/service.js';
	import orgMap from '@/static/json/orgList.json'
	const app = getApp();
	export default {
		data() {
			return {
				idcard: ""
			};
		},
		onLoad(e) {

		},
		methods: {
			bindVerify() {
				let _that = this
				if (!this.idcard) {
					this.om.toast("请输入身份证号码")
					return
				} else {
					this.om.request("smsPost/getVerifyCode2", {
						idcard: this.idcard
					}).then(res => {
						if (res.succeed) {
							let map = res.value
							uni.navigateTo({
								url: "verifycode?mobile=" + map.mobile + "&retainnum=" + map.num +
									"&idcard=" + _that.idcard
							})
						} else {
							_that.om.toast(ignoreHtml(res.msg))
						}
					})
				}
			},
			login() {
				uni.reLaunch({
					url: "../login/login"
				})
			}
		}
	};
</script>

<style>
	.forgetPwd {
		text-align: right;
		font-size: 14px;
		padding-top: 15px;
	}

	.forgetPwd a {
		text-decoration: none;
		color: #0faeff;
	}
</style>